package cn.south.campus.business.model.vo;

import cn.south.campus.business.model.entity.ExpressApply;
import cn.south.campus.common.utils.DateUtil;
import lombok.Data;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/12/23 16:33
 */
@Data
public class ExpressApplyVo {
    private Long id;

    /**
     * 用户id
     */
    private Long userId;

    private String nickname;

    private String avatar;

    private String phone;

    private String gender;

    /**
     * 代取快递id
     */
    private Long expressTakeId;


    private Long publisher;

    /**
     * 申请状态,0申请中,1已通过,2已拒绝
     */
    private Integer status;

    /**
     * 申请时间
     */
    private String applyTime;

    public static ExpressApplyVo convert(ExpressApply expressApply) {
        if (expressApply == null) {
            return null;
        }
        ExpressApplyVo expressApplyVo = new ExpressApplyVo();
        expressApplyVo.setId(expressApply.getId());
        expressApplyVo.setUserId(expressApply.getUserId());
        expressApplyVo.setNickname(expressApply.getNickname());
        expressApplyVo.setAvatar(expressApply.getAvatar());
        expressApplyVo.setPhone(expressApply.getPhone());
        expressApplyVo.setGender(expressApply.getGender());
        expressApplyVo.setExpressTakeId(expressApply.getExpressTakeId());
        expressApplyVo.setPublisher(expressApply.getPublisher());
        expressApplyVo.setStatus(expressApply.getStatus());
        expressApplyVo.setApplyTime(DateUtil.format(expressApply.getApplyTime()));
        return expressApplyVo;
    }
}
